package com.sgzn.sgpay.constants;

import java.util.ArrayList;
import java.util.List;

/**
 * 通用常量类
 * @author zhongzhongyong
 * @version Id: constants.java, v 0.1 2018/4/3 23:44 zhongzhongyong Exp $$
 */
public class Constants {

    public static final String HTTP_METHOD_POST = "POST";

    public static final String HTTP_METHOD_GET = "GET";

    public static final String CONTENT_TYPE = "Content-Type";

    public static final String CONTENT_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded";

    public static final String CONTENT_TYPE_FORM_DATA = "multipart/form-data";

    public static final String CONTENT_TYPE_XML = "text/xml";

    public static final String CONTENT_TYPE_JSON = "application/json";

    public static final String PARSE_JSON_PARM_FACTORY_BEANNAME = "parseJSONParamParamFactory";
    public static final String PARSE_FORM_PARM_FACTORY_BEANNAME = "parseQueryStringParamFactory";
    public static final String PARSE_XML_PARM_FACTORY_BEANNAME = "parseXMLParamParamFactory";

    public static final String REQUEST_HANDLE_STATE_SUCCESS = "success";
    public static final String REQUEST_HANDLE_STATE_FAILURE = "failure";
    public static final String REQUEST_HANDLE_STATE_HANDLING = "handling";

    public static final String REQUEST_ATTR_REQUEST_SEQ = "REQUEST_SEQ";
    public static final String REQUEST_ATTR_HAPPEN_EXCEPTION = "FAS_EXCEPTION";
    public static final String REQUEST_ATTR_REQUEST_CONTENT = "REQUEST_CONTENT";
    public static final String REQUEST_ATTR_REQUEST_PLATCODE = "REQUEST_PLATCODE";
    public static final String REQUEST_ATTR_RESPONSE_CONTENT = "RESPONSE_CONTENT";
    public static final String REQUEST_ATTR_RESPONSE_FAIL_REASON = "RESPONSE_FAIL_REASON";
    public static final String REQUEST_ATTR_RESPONSE_HANDLING_FLAG = "RESPONSE_HANDLING_FLAG";
    public static final String REQUEST_ATTR_REQUEST_CUSTCODE = "REQUEST_CUM";
    public static final String REQUEST_ATTR_REQUEST_INITIATION_ID = "INITIATION_ID";

    /**
     * 渠道号
     */
    public static final String CHANNEL_CODE_NAME = "channelCode";

    /**
     * 应用编号
     */
    public static final String APPNAME_NAME = "appName";

    /**
     * 交易查询中的时间跨度
     */
    public static final String QUERY_TIME_INTERVAL = "interval";

    /**
     * 完整应用名【守夜人】
     */
    public static final String FULL_APP_NAME = "bpep-fas-service";

    /**
     * 日志流水号标识名
     */
    public static final String DST_TRACE_ID = "dstTraceId";

    /**
     * 调用PGW服务成功编码
     */
    public static final String PGW_SUCCESS_CODE = "PGW04000000";

    /**
     * pe业务风控审核返回码，ARP、PGW使用
     */
    public static final String AUDIT_CODE = "668995";

    /**
     * 调用ARP服务成功编码
     */
    public static final String ARP_SUCCESS_CODE = "ARP02000000";

    /**
     * ARP签约查询没有查找到记录
     */
    public static final String ARP_NO_SIGN_CODE = "ARP02880003";

    /**
     * 调用基础服务成功编码
     */
    public static final String PFS_SUCCESS_CODE = "PFS11000000";

    /**
     * 调用公共服务成功编码
     */
    public static final String PBS_SUCCESS_CODE = "PBS17000000";


    /**
     * 调用CIF服务成功编码
     */
    public static final String CIF_SUCCESS_CODE = "200000";


    /**
     * 调用复合支付服务成功编码
     */
    public static final String PCP_SUCCESS_CODE = "PCP14000000";
    /**
     * 复合支付分账部分成功编码
     */
    public static final String PCP_PART_SUCCESS_CODE = "PCP14880026";
    /**
     * 复合支付冲正部分成功，处理中编码
     */
    public static final String PCP_REVERSE_HANDLING_CODE = "PCP14880030";
    /**
     * 复合支付交易处理中，如充值转账，当充值或者转账超时时，总的响应码使用这个
     */
    public static final String PCP_TRANS_HANDLING_CODE = "PCP14880001";
    /**
     * 复合支付交易处理失败，如充值转账，响应码是这个时丢弃result
     */
    public static final String PCP_TRANS_FAIL_CODE = "PCP14880003";

    /**
     * 调用安全服务成功编码
     */
    public static final String SEC_SUCCESS_CODE = "SEC12000000";

    public static final String CUM_SUCCESS_CODE = "CUM09000000";

    /**
     * 调资金归集成功编码
     */
    public static final String FCA_SUCCESS_CODE = "FCA31000000";

    /**
     * BCS成功编码
     */
    public static final String BCS_SUCCESS_CODE = "0000";
    /**
     * BCS系统错误
     */
    public static final String BCS_FAIL_CODE = "9999";
    /**
     * 支付方式：企业账户，用于计算手续费
     */
    public static final String PAY_TYPE_ACC = "ACC";
    /**
     * 支付方式：无磁无密，用于计算手续费
     */
    public static final String PAY_TYPE_AGR = "AGR";
    /**
     * 支付方式：外部转账，用于计算手续费
     */
    public static final String PAY_TYPE_EXTERNAL = "EXT";

    /**
     * 分账方式：固定金额
     */
    public static final String LEDGER_TYPE_F = "F";

    /**
     * 分账方式：比例
     */
    public static final String LEDGER_TYPE_P = "P";

    /**
     * 前置交易拦截标识：拦截
     */
    public static final String INTERRUPT_FLAG_Y = "Y";

    /**
     * 前置交易拦截标识：不拦截
     */
    public static final String INTERRUPT_FLAG_N = "N";

    /**
     * 子单标识
     */
    public static final String IS_NOT_MAIN = "0";

    /**
     * 允许冲正
     */
    public static final String ALLOW_REVERSE_TRUE = "ALLOW";
    /**
     * 不允许冲正
     */
    public static final String ALLOW_REVERSE_FALSE = "NOT_ALLOW";
    /**
     * 未定义，不知是否允许冲正
     */
    public static final String ALLOW_REVERSE_UNKNOW = "UNKNOWN";

    /**
     * 冲正、退款交易时限周期起始日期
     */
    public static final String TIME_LIMIT_KEY_START = "PeriodStart";
    /**
     * 冲正、退款交易时限周期结束日期
     */
    public static final String TIME_LIMIT_KEY_END = "PeriodEnd";

    /**
     * 客户注册类型：企业
     */
    public static final String CUST_REGIST_TYPE_ENTERPRISE = "PRT1002";
    /**
     * 客户注册类型：个人
     */
    public static final String CUST_REGIST_TYPE_PERSION = "PRT1001";

    /**
     * 回传商户交易信息时，与商户约定好的接收确认响应信息
     */
    public static final String CALLBACK_CONFIRM = "BUSINESS_CONFIRM";

    /**
     * 电子回单压缩包名前缀
     */
    public static final String ELE_RECEIPT_NAME_PRE = "eleReceipt_";
    /**
     * 电子回单压缩包名后缀
     */
    public static final String ELE_RECEIPT_NAME_SUFFIX = ".zip";
    /**
     * 电子回单下载地址配置文件key值
     */
    public static final String ELE_RECEIPT_URL = "eleReceipt.url";

    /**
     * 文件系统参数key值
     */
    public static final String FSM_FILE_NAME = "fileName";

    /**
     * 虚拟账户
     */
    public static final String VIRTUAL_ACCOUNT = "0000000000000000";

    /**
     * 短信码加密秘钥配置名
     */
    public static final String SMS_KEY = "smsKey";

    public static final String VALUE_FOR_STOP_SAME_ORDER = "1";

    /**
     * 资金系统类型：EBK企业账户
     */
    public static final String CAP_SYS_TYPE_EBK = "EBK";

    /**
     * 接口类型标识：认证类
     */
    public static final String TRS_FLAG_V = "V";
    /**
     * 接口类型标识：交易类
     */
    public static final String TRS_FLAG_T = "T";
    /**
     * 接口类型标识：非交易类
     */
    public static final String TRS_FLAG_Q = "Q";

    /**
     * 交易同步异步标识：同步
     */
    public static final String ASYNC_FLAG_S = "S";
    /**
     * 交易同步异步标识：异步
     */
    public static final String ASYNC_FLAG_A = "A";

    /**
     * 广东电信平台号标识
     */
    public static final String TELECOM_PLATCODE = "telecom.platCode";

    /**
     * 企业账户充值个人账户充值类型为可提现
     */
    public static final String PERMIT_WITHDRAW = "02";
    /**
     * 企业账户充值个人账户充值类型为不可提现
     */
    public static final String NOT_PERMIT_WITHDRAW = "03";

    /**
     * 企业账户充值个人账户可提现产品编码
     */
    public static final String PERMIT_WITHDRAW_PRODUCT_CODE = "0101411014";
    /**
     * 企业账户充值个人账户不可提现产品编码
     */
    public static final String NOT_PERMIT_WITHDRAW_PRODUCT_CODE = "0101412014";

    /**
     * 通用返回报文是否成功判断码：一般认为返回报文最后是6个0，刚认为其成功，此常量为6个0
     */
    public static final String COMMON_SUCCESS_CODE = "000000";

    /**
     * pbs审核在线绑卡业务标识
     */
    public static final String ADUIT_BUSINESS_FLAG_FOR_BIND_CARD = "OMS_ONLINE_ADD_CUS_CARD";

    /**
     * 调用开放平台服务处理中编码
     */
    public static final String API_HANDLING_CODE = "API500005";

    /**
     * 调用开放平台服务签名认证失败编码
     */
    public static final String API_SIGN_FAIL_CODE = "API100001";

    /**
     * 电子回单url标识
     */
    public static final String ERECEIPT_URL = "portal.ereceipt.url";


    /**
     * 运营商-电信
     */
    public static final String CARRIER_DX = "dx";
    /**
     * 运营商-移动
     */
    public static final String CARRIER_YD = "yd";
    /**
     * 运营商-联通
     */
    public static final String CARRIER_LT = "lt";

    public static final String ROOT_PRIV_ID = "000000";

    /**
     * 忽略加密、解密的字段
     */
    public static final List<String> IGNORE_FIELDS_LIST = new ArrayList<>();

    static {
        IGNORE_FIELDS_LIST.add("key");
        IGNORE_FIELDS_LIST.add("reqIp");
        IGNORE_FIELDS_LIST.add("platCode");
        IGNORE_FIELDS_LIST.add("appName");
        IGNORE_FIELDS_LIST.add("appType");
        IGNORE_FIELDS_LIST.add("subAppType");
        IGNORE_FIELDS_LIST.add("channelCode");
        IGNORE_FIELDS_LIST.add("reqTime");
        IGNORE_FIELDS_LIST.add("initiationID");
        IGNORE_FIELDS_LIST.add("privilegeCode");
    }

    /**
     * 常量类，构造函数设置私有
     */
    private Constants() {
    }

}
